home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / picture / simpict.c < prev    next >
Text File  |  1993-09-23  |  1KB  |  59 lines

  1. //    Copyright 1993 Ralph Gonzalez
  2.  
  3. /*
  4. *    FILE:        simpict.c
  5. *    AUTHOR:        R. Gonzalez
  6. *    CREATED:    October 4, 1990
  7. *
  8. *    Test simple pict application.
  9. */
  10.  
  11. # include    "simpict.h"
  12.  
  13. /******************************************************************
  14. *    initialize
  15. ******************************************************************/
  16. Simple_Pict::Simple_Pict(void)
  17. {
  18.     projector1 = new Projector;
  19.     projector1->set_cropping_frame(5.,5.,10.,10.);
  20.     projector1->set_projection_frame(0.,0.,1.,1.);
  21.     projector1->set_background_color(CYAN);
  22.     projector1->set_screen(screen);
  23.  
  24.     projector2 = new Corner_Projector;
  25.     projector2->set_cropping_frame(5.,5.,10.,10.);
  26.     projector2->set_screen(screen);
  27.     
  28.     c1 = new Coord2;
  29.     c2 = new Coord2;
  30. }
  31.  
  32. /******************************************************************
  33. *    run
  34. ******************************************************************/
  35. void    Simple_Pict::run(void)
  36. {
  37.     c1->set(1.,1.);
  38.     c2->set(9.,9.);
  39.     
  40.     projector1->show_line(c1,c2,RED);
  41.     projector2->show_line(c1,c2,BLUE);
  42.     
  43.     screen->wait();
  44. }
  45.  
  46. /******************************************************************
  47. *    destroy
  48. ******************************************************************/
  49. Simple_Pict::~Simple_Pict(void)
  50. {
  51.     delete c1;
  52.     delete c2;
  53.     
  54.     delete projector1;
  55.     delete projector2;
  56. }
  57.  
  58.     
  59.